package cn.kickegg.gc.oom;

import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @author by KickEGG
 * @createTime $YEAR-$MONTH-25 20:28
 * @Description
 */
public class MetaSpaceOOM {
  public static void main(String[] args) {
    while (true){
      Enhancer enhancer = new Enhancer() ;
      enhancer.setSuperclass(HeapOOM.class);
      enhancer.setUseCache(false) ;
      enhancer.setCallback(new MethodInterceptor() {
        @Override
        public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
          return methodProxy.invoke(o,objects) ;
        }
      });
      enhancer.create() ;

    }
  }
}

